﻿using DAL;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class MemberInfoBLL
    {

        private MemberInfoDAL _memberInfo = new MemberInfoDAL();
        //分页查询会员信息
        public DataTable MemberInfoSelect(int pageIndex, int pageSize)
        {
            
            //调用DAL查询会员信息

            return _memberInfo.SelectMember(pageIndex, pageSize);
        }

        public int MemberCountSelect(int pageSize)
        {
            //调用DAL查询会员总页数

            return _memberInfo.SelectMemberCount(pageSize);
        }

        public int DeleteMemberInfo(int id)
        {
            //调用DAL删除会员
            return _memberInfo.DeleteMemberInfo(id);
        }


        public DataTable IdOrNameSelect(int id, string name, bool isId)
        {
            //调用DAL搜索
            return _memberInfo.SelectIdOrName(id, name, isId);
        }

        public int UpdateMemberInfo(MemberInfo memberInfo)
        {

            //调用DAL进行修改
            return _memberInfo.UpdateMember(memberInfo);
        }

        public MemberInfo SelectMemberByEndnum(string phoneNum)
        {
            return _memberInfo.SelectMemberByEndnum(phoneNum);
        }


        //结账
        public int SubMoney(int mid, double money)
        {
            return _memberInfo.SubMoney(mid, money);
        }
    }
}
